<!-- 通信类 决算  工程档案信息 -->
<template>
  <TCollapse title="工程档案信息">
    <div ref="queryFormBox" class="search-flex-box">
      <!-- <BtnConfig ref="btnConfigRef" class="marginBottom14" :btn-configs="btnOption" @propClick="btnClick" />  不要了-->
      <Form
        ref="formRef"
        v-model="engineeringArchiveInformationList"
        :form-option="formOption"
        :select-list="dicLists"
      />
    </div>
  </TCollapse>
</template>

<script>
import Form from '@/views/actualBudget/communication/tFbusiness/pmsForm'
// import BtnConfig from '@/components/basic/btnConfig.vue'
import { getDropdownData } from '@/api/common' // 字典接口
import TCollapse from '@/components/basic/TCollapse.vue'
// 查询条件配置
const formOption = {
    size: 'mini',
    inline: true,
    labelWidth: '160px',
    itemData: [
        {
            type: 'select',
            prop: 'isQualified',
            dateType: 'date',
            value: '',
            width: '',
            colSpan: 6,
            label: '工程档案是否完备',
            clearable: true,
            dicType: 'IS_QUALIFIED',
            dicProp: {
                label: 'dictName',
                value: 'dictId'
            }
        }
    ]
}

// 列表按钮配置
const btnOption = [
    { label: '工程资料全览', fun: 'attachmentInfo', type: '' }
]

export default {
    name: 'ActualTime',
    components: {
        Form,
        TCollapse
        // BtnConfig
    },
    props: {
        engineeringArchiveInformationList: {
            type: Object,
            default: () => ({})
        },
        urlList: {
            type: Object,
            default: () => ({})
        },
        lcList: {
            type: Object,
            default: () => ({})
        },
        prjId: {
            type: String,
            default: ''
        },
        onNotShow: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {
            btnOption,
            fileUrl: process.env.VUE_APP_ZHONGRUAN_URL,
            formOption, // 查询条件配置项
            dialogCheckbox: false, // 自定义列表弹框
            attachmentInfoNewSrc: '',
            dicLists: {} // 下拉框字典选项集合
        }
    },
    created() {
        this.getDictData()
    },
    mounted() {
        if (this.urlList.type === 'done' || this.onNotShow) {
            this.formOption.itemData[0].disabled = true
        }
    },
    methods: {
        // 列表按钮点击事件
        btnClick(fun, row) {
            this[fun](row)
        },
        // 资料全揽
        attachmentInfo() {
            this.attachmentInfoNewSrc = `${this.fileUrl}attachmentFullView?prjId=${this.prjId}`
            window.open(this.attachmentInfoNewSrc)
        },
        // 获取下拉框数据
        async getDictData() {
            const arr = ['IS_QUALIFIED']
            const promises = arr.map(item => getDropdownData(item))
            const results = await Promise.all(promises)
            arr.forEach((item, i) => {
                this.$set(this.dicLists, item, results[i].data ?? [])
            })
        }
    }
}
</script>

  <style lang="scss" scoped>
.search-flex-box {
    // display: flex;
    // justify-content: space-between;
    height: auto;
}

.searchBtn {
    width: 100px;
    margin-left: auto;
    display: flex;
    margin-top: 4px;
    flex-direction: column;

    .el-button + .el-button {
        margin-left: 0;
        margin-top: 8px;
    }
}

.electronicSignature {
    width: 100%;

    .mainDetails {
        padding: 20px 25px 0px;
    }

    .topRemark {
        // background-color: #fdf5e6;
        background-color: #ffefd5;
        width: 100%;
        height: 40px;
        line-height: 40px;
        padding-left: 10px;
        font-size: 14px;

        .asterisk {
            color: #f00;
            margin-right: 2px;
            font-size: 18px;
        }
    }

    .customBtn {
        height: 20px;
        line-height: 20px;
        font-size: 14px;
        margin: 10px 20px 10px 90%;
        cursor: pointer;

        .el-icon-s-tools {
            font-size: 20px;
            color: #999;
            margin-right: 6px;
        }
    }
}

.el-button--text {
    color: #02a7f0;
}

.el-button--primary {
    color: #fff;
}

.dialog-footer {
    display: flex;
    justify-content: center;
}

::v-deep .el-button + .el-button {
    color: #fff;
}

// 弹框样式
::v-deep .el-dialog__body {
    max-height: 400px;
    overflow-y: auto;
    margin: 0px;
}

// 滚动条样式
::v-deep .el-dialog__body::-webkit-scrollbar {
    // 滚动条整体样式
    width: 6px; //高宽分别对应横竖滚动条的尺寸
    height: 10px;
}

::v-deep .el-dialog__body::-webkit-scrollbar-thumb {
    // 滚动条里面小方块
    border-radius: 10px;
    // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    background: #f2f3f5;
}

::v-deep .el-range-editor.el-input__inner {
    padding: 0px 10px;
}

.topBtn {
    text-align: center;
    padding: 20px;
}

::v-deep .el-tag {
    border: none;
    color: #02a7f0;
    background-color: #ffffff;
}

::v-deep .el-dialog__title {
    font-size: 14px;
    font-weight: bold;
}

::v-deep .el-col-24 {
    height: 110px;
}

::v-deep .el-textarea.is-disabled .el-textarea__inner {
    background-color: #f7f7f7;
}
</style>
